// export const ARCGIS_JS_API_URL = 'http://31.0.37.225/arcgis_js_api/library/4.13/dojo/dojo.js';
export const ARCGIS_JS_API_URL = 'http://10.108.3.41/arcgis_js_api/library/4.13/dojo/dojo.js';

export var ALL_LAYER = 'ALL_LAYER';
export var MAP = 'CSJ_MAP';
export var SCENE_VIEW = 'CSJ_SCENE_VIEW';
export var SCENE_VIEW_LEGEND = 'CSJ_SCENE_VIEW_LEGEND';

export var GRAPHIC_LAYER_HOVER = 'GRAPHIC_LAYER_HOVER';
export var GRAPHIC_LAYER_SELECTED = 'GRAPHIC_LAYER_SELECTED';


var labels = [ '$feature.name', '$feature.definition' ];


//与OPERATION_SERVICE_LAYERS保持对应
export var SHC_TILED_MAPSERVICE_LAYERS =
  [
    { id: 'SUSEMAP', title: '素色底图', group: '底图', url: 'http://map.smi.sh.cegn.cn/OneMapServer/rest/services/shmap_ss/MapServer', group: 'basemap' },
    // { id: 'ANSEMAP', title: '暗色底图', group:'底图', url: 'http://map.smi.sh.cegn.cn/OneMapServer/rest/services/shmap_as2/MapServer', group: 'basemap'},
  ]
export var TILED_MAPSERVICE_LAYERS = [
  // { id: 'HEISEMAP', title: '黑色底图', url: 'http://10.108.3.6:6080/arcgis/rest/services/darkmap/MapServer' }
  { id: 'ANSEMAP', title: '暗色底图', group:'底图', url: 'http://10.108.3.48/changsanjiao/rest/services/Anse_Map/MapServer', group: 'basemap'},
  { id: 'AIR_2020', title: '2020影像', group: '底图', url: 'http://10.108.3.16/arcgis/rest/services/basemap_air/MapServer',visible:false, group: 'basemap' },
  { id: 'ZWMAP', title: '政务底图', group: '底图', url: 'http://10.108.3.16/arcgis/rest/services/basemap_light/MapServer', group: 'basemap' },
  {
    id: 'roadlineNET', title: '城市路网', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/roadlineNET_0812/MapServer', group: 'traffic',opacity:0.2,visible:true,
  },{
    id: 'landuse_mainarea3', title: '用地分类底图', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/landuse_mainarea3/MapServer', group: 'traffic',opacity:0.2
  },{
    id: 'planBGSys', title: '规划蓝绿系统', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/planBGSys/MapServer', group: 'traffic',opacity:0.6,
  },{
    id: 'waterRegion', title: '水域', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/waterRegion/MapServer', group: 'traffic',opacity:0.4,
  },
]
export var SHC_D_MAPSERVICE_LAYERS = [
  //公用设施
]

export var FEATURELAYER_LAYERS = [


  //土地出让
  {
    id: 'leadingproject_landsell2', title: '土地出让（地块尺度）', url: 'http://10.108.3.50/changsanjiao/rest/services/Lgplaninfo/FeatureServer/13', group: 'landplan873',opacity:0.7,
    labelingInfo: [{
      symbol: {
        type: 'label-3d',
        symbolLayers: [{
          type: 'text',
          material: {
            color: 'white'
          },
          halo: {
            color: [0, 0, 0, 0.7],
            size: 1
          },
          size: 11,
          font:{weight:"bold"}
        }]
      },
      labelPlacement: 'above-center',
      labelExpressionInfo: {
        expression: '$feature.land_name'
      }
    }],
    popupEnabled:true,
    popupTemplate: {
      content: [
        {
          type: 'fields',
          fieldInfos: [{
            fieldName: 'LAND_NAME',
            visible: true,
            label: '地块名称',
          },{
            fieldName: 'ZONE_NAME',
            visible: true,
            label: '园区名称',
          },{
            fieldName: 'land_process',
            visible: true,
            label: '土地出让状态',
          },{
            fieldName: 'Show_code',
            visible: true,
            label: '用地性质代码',
          },{
            fieldName: 'Show_name',
            visible: true,
            label: '用地性质名称',
          },{
            fieldName: 'plot_ratio',
            visible: true,
            label: '规划容积率',
          },{
            fieldName: 'land_Square',
            visible: true,
            label: '地块面积（公顷）',
            format:{digitSeparator:true,places:2}
          },]
        }
      ],
    }
  },{
    id: 'leadingproject_landsell1', title: '土地出让（组团尺度）', url: 'http://10.108.3.50/changsanjiao/rest/services/Lgplaninfo/FeatureServer/12', group: 'landplan873',opacity:0.7,
    labelingInfo: [{
      symbol: {
        type: 'label-3d',
        symbolLayers: [{
          type: 'text',
          material: {
            color: 'white'
          },
          halo: {
            color: [0, 0, 0, 0.7],
            size: 1
          },
          size: 11,
          font:{weight:"bold"}
        }]
      },
      labelPlacement: 'above-center',
      labelExpressionInfo: {
        expression: '$feature.land_name'
      },
      "minScale": 6000,
      /* "maxScale": , */
    }],
    popupEnabled:true,
    popupTemplate: {
      content: [
        {
          type: 'fields',
          fieldInfos: [{
            fieldName: 'LAND_NAME',
            visible: true,
            label: '地块名称',
          },{
            fieldName: 'ZONE_NAME',
            visible: true,
            label: '园区名称',
          },{
            fieldName: 'land_process',
            visible: true,
            label: '土地出让状态',
          },{
            fieldName: 'Show_code',
            visible: true,
            label: '用地性质代码',
          },{
            fieldName: 'Show_name',
            visible: true,
            label: '用地性质名称',
          },{
            fieldName: 'plot_ratio',
            visible: true,
            label: '规划容积率',
          },{
            fieldName: 'land_Square',
            visible: true,
            label: '地块面积（公顷）',
            format:{digitSeparator:true,places:2}

          },]
        }
      ],
    }
  },
  //控规覆盖
 {
   id: 'keyCity_landuse2', title: '未录入部分规划（地块尺度）', url: 'http://10.108.3.50/changsanjiao/rest/services/Lgplaninfo/FeatureServer/10', group: 'landplan873',
   popupEnabled:true,
   opacity:0.7,
   popupTemplate: {
     content: [
       {
         type: 'fields',
         fieldInfos: [
         {
           fieldName: 'Code',
           visible: true,
           label: '用地性质编码',
         },
         {
           fieldName: 'LandUSE',
           visible: true,
           label: '用地性质名称',
         },{
           fieldName: 'REGULATORYPlan_Status',
           visible: true,
           label: '控规状态',
         },{
           fieldName: 'land_Squar',
           visible: true,
           label: '地块面积（公顷）',
           format:{digitSeparator:true,places:2}

         },
       ]
       }
     ]
   }
 },{
  id: 'keyCity_landuse1', title: '未录入部分规划（组团尺度）', url: 'http://10.108.3.50/changsanjiao/rest/services/Lgplaninfo/FeatureServer/7', group: 'landplan873',
  popupEnabled:true,
  opacity:0.7,
  popupTemplate: {
    content: [
      {
        type: 'fields',
        fieldInfos: [
        {
          fieldName: 'Code',
          visible: true,
          label: '用地性质编码',
        },
        {
          fieldName: 'LandUSE',
          visible: true,
          label: '用地性质名称',
        },{
          fieldName: 'REGULATORYPlan_Status',
          visible: true,
          label: '控规状态',
        },{
          fieldName: 'land_Squar',
          visible: true,
          label: '地块面积（公顷）',
          format:{digitSeparator:true,places:2}
        },
      ]
      }
    ]
  }
 },{
   id: 'plan_landuse2', title: '已录入控规用地（地块尺度）', url: 'http://10.108.3.50/changsanjiao/rest/services/Lgplaninfo/FeatureServer/9', group: 'landplan873',
   popupEnabled:true,
   opacity:0.7,
   popupTemplate: {
     content: [
       {
         type: 'fields',
         fieldInfos: [{
           fieldName: 'zoneid',
           visible: true,
           label: '控详单元',
         },{
           fieldName: 'blockid',
           visible: true,
           label: '街坊号',
         },{
           fieldName: 'PARCELID',
           visible: true,
           label: '地块编号',
         },{
           fieldName: 'show_code',
           visible: true,
           label: '用地性质编码',
         },{
           fieldName: 'show_name',
           visible: true,
           label: '用地性质名称',
         },{
           fieldName: 'planfar',
           visible: true,
           label: '容积率上限',
         },{
           fieldName: 'heightlimit',
           visible: true,
           label: '建筑限高',
         },{
           fieldName: 'land_Square',
           visible: true,
           label: '地块面积（公顷）',
           format:{digitSeparator:true,places:2}
         },{
           fieldName: 'approveldate',
           visible: true,
           label: '控详批复日期',
         },]
       }
     ]
   }
 },{
  id: 'plan_landuse1', title: '已录入控规用地（组团尺度）', url: 'http://10.108.3.50/changsanjiao/rest/services/Lgplaninfo/FeatureServer/6', group: 'landplan873',
  popupEnabled:true,
  opacity:0.7,
  popupTemplate: {
    content: [
      {
        type: 'fields',
        fieldInfos: [{
          fieldName: 'zoneid',
          visible: true,
          label: '控详单元',
        },{
          fieldName: 'blockid',
          visible: true,
          label: '街坊号',
        },{
          fieldName: 'PARCELID',
          visible: true,
          label: '地块编号',
        },{
          fieldName: 'show_code',
          visible: true,
          label: '用地性质编码',
        },{
          fieldName: 'show_name',
          visible: true,
          label: '用地性质名称',
        },{
          fieldName: 'planfar',
          visible: true,
          label: '容积率上限',
        },{
          fieldName: 'heightlimit',
          visible: true,
          label: '建筑限高',
        },{
          fieldName: 'land_Square',
          visible: true,
          label: '地块面积（公顷）',
          format:{digitSeparator:true,places:2}

        },{
          fieldName: 'approveldate',
          visible: true,
          label: '控详批复日期',
        },]
      }
    ]
  }
 },{
   id: 'plan_uncover', title: '控规未覆盖范围', url: 'http://10.108.3.50/changsanjiao/rest/services/Lgplaninfo/FeatureServer/4', group: 'landplan873',
   renderer: {
     type: 'simple',
     symbol: {
       type: 'simple-line',
       color: [255, 211, 175, 1],
       width:4,
     },
   },
  },{
    id: 'plantrafficSys1', title: '公共交通设施', url: 'http://10.108.3.50/changsanjiao/rest/services/Lgplaninfo/FeatureServer/1', group: 'landplan873',
  },{
    id: 'plantrafficSys2', title: '公共交通线位', url: 'http://10.108.3.50/changsanjiao/rest/services/Lgplaninfo/FeatureServer/2', group: 'landplan873',
  },{
    id: 'industryfuncArea', title: '产业空间布局', url: 'http://10.108.3.50/changsanjiao/rest/services/LG_landuse1/FeatureServer/2', group: 'landplan873',opacity:0.8,
  },{
    id: 'privatelifeArea', title: '住房空间布局', url: 'http://10.108.3.50/changsanjiao/rest/services/LG_landuse1/FeatureServer/1', group: 'landplan873',
  },{
    id: 'LGplan_landuse', title: '规划用地布局', url: 'http://10.108.3.50/changsanjiao/rest/services/LG_landuse1/FeatureServer/0', group: 'landplan873',opacity:0.8,
  },


  //城市边界
  {
    id: 'areaBoundary', title: '区界', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/cityboundary/FeatureServer/3', group: 'cityBou',
  },{
    id: 'leadingproject', title: '新兴产业引领区重点项目', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/leadingproject/FeatureServer/6', group: 'cityBou',
    labelingInfo: [{
      symbol: {
        type: 'label-3d',
        symbolLayers: [{
          type: 'text',
          material: {
            color: 'white'
          },
          halo: {
            color: [0, 0, 0, 0.7],
            size: 3
          },
          size: 20,
          font:{weight:"bold"}
        }]
      },
      labelPlacement: 'above-along',
      labelExpressionInfo: {
        expression: '$feature.NAME'
      }
    }],
  },{
    id: 'leadingprojectboundary', title: '新兴产业引领区边界', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/leadingproject/FeatureServer/7', group: 'cityBou',
  },{
    id: 'innovationproject', title: '国际创新协同区边界', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/innovationproject/FeatureServer', group: 'cityBou',
    // labelingInfo: [{
    //   symbol: {
    //     type: 'label-3d',
    //     symbolLayers: [{
    //       type: 'text',
    //       material: {
    //         color: 'white'
    //       },
    //       halo: {
    //         color: [0, 0, 0, 0.7],
    //         size: 3
    //       },
    //       size: 20,
    //       font:{weight:"bold"}
    //     }]
    //   },
    //   labelPlacement: 'above-center',
    //   labelExpressionInfo: {
    //     expression: '$feature.NAME'
    //   }
    // }],
  },{
    id: 'serviceproject', title: '现代服务业开放区边界', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/serviceproject/FeatureServer', group: 'cityBou',
    labelingInfo: [{
      symbol: {
        type: 'label-3d',
        symbolLayers: [{
          type: 'text',
          material: {
            color: 'white'
          },
          halo: {
            color: [0, 0, 0, 0.7],
            size: 3
          },
          size: 20,
          font:{weight:"bold"}
        }]
      },
      labelPlacement: 'above-center',
      labelExpressionInfo: {
        expression: '$feature.name'
      }
    }],
  },{
    id: 'areaslinkagePolygon', title: '五区联动边界', url: 'http://10.108.3.50/changsanjiao/rest/services/lg_threepolyon/FeatureServer/0', group: 'cityBou',
    renderer: {
      type: 'simple',
      symbol: {
        type: 'simple-fill',
        color: [36, 241, 254, 0],
        outline: {
          color: [255, 255, 115, 1],
          width: 4
        }
      }
    },
    labelingInfo: [{
      symbol: {
        type: 'label-3d',
        symbolLayers: [{
          type: 'text',
          material: {
            color: 'white'
          },
          halo: {
            color: [0, 0, 0, 0.7],
            size: 2
          },
          size: 12,
          font:{weight:"bold"}
        }]
      },
      labelPlacement: 'above-center',
      labelExpressionInfo: {
        expression: '$feature.name_1'
      }
    }],
  },{
    id: 'itemStartRegionlabel', title: '启动区名称', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/startRegionlabel/FeatureServer', group: 'LGlabel',visible:true,
    labelingInfo: [{
      symbol: {
        type: 'label-3d',
        symbolLayers: [{
          type: 'text',
          material: {
            color: 'white'
          },
          halo: {
            color: [0, 0, 0, 0.7],
            size: 3
          },
          size: 15,
         font:{weight:"bold"}
        }]
      },
      labelPlacement: 'above-center',
      labelExpressionInfo: {
        expression: '$feature.Name'
      },

    }],
  },{
    id: 'itemStartRegion', title: '启动区边界', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/startRegion/FeatureServer', group: 'cityBou',
    // elevationInfo: {
    //   mode: "absolute-height",
    //   offset: 5
    // },
    renderer: {
      type: 'simple',
      symbol: {
        type: 'simple-fill',
        color: [36, 241, 254, 0],
        outline: {
          color: [255, 255, 115, 1],
          width: 4
        }
      }
    },
    visible: true
  },{
    id: 'pianquMark', title: '主城区片区划分标注', url: 'http://10.108.3.50/changsanjiao/rest/services/pianquMark/FeatureServer', group: 'LGlabel',
    labelingInfo: [{
      symbol: {
        type: 'label-3d',
        symbolLayers: [{
          type: 'text',
          material: {
            color: [255,255,190,1]
          },
          halo: {
            color: [0, 0, 0, 0.7],
            size: 4
          },
          size: 20,
          font:{weight:"bold"}
        }]
      },
      labelPlacement: 'above-center',
      labelExpressionInfo: {
      //   expression: `
      //   var name = $feature.name;
      //   var definition = $feature.definition;
      //   var labels = [ name, definition];
      //   return Concatenate(labels, TextFormatting.NewLine);
      // `
        expression: "$feature.name"

      },
    },
  ],
  },{
    id: 'keyCity_classification', title: '主城区片区划分', url: 'http://10.108.3.50/changsanjiao/rest/services/lg_threepolyon/FeatureServer/1', group: 'cityBou',
  },{
    id: 'keyCity_label', title: '主城区标注', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/keyCity_label/FeatureServer', group: 'LGlabel',visible:true,
    labelingInfo: [{
      symbol: {
        type: 'label-3d',
        symbolLayers: [{
          type: 'text',
          material: {
            color: 'white'
          },
          halo: {
            color: [0, 0, 0, 0.7],
            size: 3
          },
          size: 15,
          font:{weight: "bold"}
        }]
      },
      labelPlacement: 'above-center',
      labelExpressionInfo: {
        expression: '$feature.name'
      },
      /* "minScale": 1024000,
      "maxScale": 500, */
    }],
  },{
    id: 'keyCityBoundary', title: '主城区边界', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/cityboundary/FeatureServer/2', group: 'cityBou', visible: true,
    renderer: {
      type: 'simple',
      symbol: {
        type: 'simple-line',
        color: [255, 255, 190, 1],
        width:4,
      },
    },
  },{
    id: 'pointCity_label', title: '集建区标注', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/pointcitylabel/FeatureServer', group: 'LGlabel',opacity:0,
    elevationInfo: {
      mode: "absolute-height",
      offset: 5
    },
    labelingInfo: [{
      symbol: {
        type: 'label-3d',
        symbolLayers: [{
          type: 'text',
          material: {
            color: 'white'
          },
          halo: {
            color: [0, 0, 0, 0.7],
            size: 3
          },
          size: 10,
          font:{weight:"bold"}
        }]
      },
      labelPlacement: 'above-center',
      labelExpressionInfo: {
        expression: '$feature.name'
      },
      /* "minScale": 1024000,
      "maxScale": 500, */
    }],
  },{
    id: 'pointCityBoundaryLayer', title: '集建区边界', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/pointCityBoundary/FeatureServer/2', group: 'cityBou',
    popupEnabled:true,
    popupTemplate: {
      content: [
        {
          type: 'fields',
          fieldInfos: [{
            fieldName: 'area',
            visible: true,
            label: '集建区名称',
          }]
        }
      ],
    }
  },{
    id: 'southairportBoundaryLayer', title: '机场南片区边界', url: "http://10.108.3.50/changsanjiao/rest/services/Hosted/pointCityBoundary/FeatureServer/3", group: 'cityBou',
  },{
    id: 'xinpianBoundary', title: '新片区边界', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/cityboundary/FeatureServer/1', group: 'cityBou', visible: true,
    renderer: {
      type: 'simple',
      symbol: {
        type: 'simple-line',
        color: [255, 255, 255, 1],
        width:5,
      },
    },
  },
  //城市路网


]

export var D_MAPSERVICE_LAYERS = [

]


export var SCENE_LAYERS = [
  {
    id: 'WHITE_BUILDING', title: '城市白模', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/xinpianquBuilding0819/SceneServer', group: 'building',
    elevationInfo: {
      mode: "absolute-height",
      offset: 0.5
    },
    visible: false,
    popupEnabled:true,
    popupTemplate: {
      content: [
        {
          type: 'fields',
          fieldInfos: [
            {
              fieldName: 'name',
              visible: true,
              label: '建筑名',
            }]
        }
      ],
    },
   /*  definitionExpression: "Is_Intersect = '0'",
    renderer: {
      type: "simple",
      symbol: {
        type: "mesh-3d",
        symbolLayers: [{
          type: "fill",
          material: {
            color: [96, 96, 96, 0.8],
            colorMixMode: "replace"
          },
          edges: {
            type: "solid",
            color: [0, 0, 0, 0.9],
            size: 1
          }
        }]
      }
    } */
    renderer: {
      type: 'unique-value',
      defaultSymbol: {
        type: 'mesh-3d',
        symbolLayers: [
          {
            type: 'fill',
            material: {
              color: [96, 96, 96, 1],
              colorMixMode: 'replace',
            },
            edges: {
              type: 'solid',
              color: [0, 0, 0, 0.9],
              size: 1,
            },
          },
        ],
      },
      valueExpression:
        '$feature.Is_Intersect',
      uniqueValueInfos: [
        {
          value: '0',
          symbol: {
            type: 'mesh-3d',
            symbolLayers: [
              {
                type: 'fill',
                material: {
                  color: [255, 255, 190,1],
                  colorMixMode: 'replace',
                },
                edges: {
                  type: 'solid',
                  color: [0, 0, 0, 0.9],
                  size: 0.5
                },
              },
            ],
          },
        },
        {
          value: '1',
          symbol: {
            type: 'mesh-3d',
            symbolLayers: [
              {
                type: 'fill',
                material: {
                  color: [253, 250, 64, 0.9],
                  colorMixMode: 'replace',
                },
                edges: {
                  type: 'solid',
                  color: [0, 0, 0, 0.6],
                  size: 0.5,
                },
              },
            ],
          },
        }
      ],
    },
  },
  {
    id: 'PLAN_BUILDING', title: '规划模型', url: 'http://10.108.3.50/changsanjiao/rest/services/Hosted/lgPlanModel0819/SceneServer', group: 'building',
    popupEnabled:false,
    elevationInfo: {
      mode: "absolute-height",
      offset: 0.5
    },
    visible: false,

    definitionExpression: "Is_Intersect <> '1'",
    renderer: {
      type: 'unique-value',
      valueExpression:
        '$feature.Is_Intersect',
      uniqueValueInfos: [
        {
          value: '2',
          symbol: {
            type: 'mesh-3d',
            symbolLayers: [
              {
                type: 'fill',
                material: {
                  color: [253, 250, 64, 0.9],
                  colorMixMode: 'replace',
                },
                edges: {
                  type: 'solid',
                  color: [0, 0, 0, 0.6],
                  size: 0.5,
                },
              },
            ],
          },
        },{
          value: '0',
          symbol: {
            type: 'mesh-3d',
            symbolLayers: [
              {
                type: 'fill',
                material: {
                  color: [255, 255, 255, 0.8],
                  colorMixMode: 'replace',
                },
                edges: {
                  type: 'solid',
                  color: [0, 0, 0, 0.6],
                  size: 0.5,
                },
              },
            ],
          },
        }
      ],
    /* definitionExpression: "Is_Intersect <> '1'",
    renderer: {
      type: "simple",
      symbol: {
        type: "mesh-3d",
        symbolLayers: [{
          type: "fill",
          material: {
            color: [255, 255, 255, 0.8],
            colorMixMode: "replace"
          },
          edges: {
            type: "solid",
            color: [0, 0, 0, 0.4],
            size: 1
          }
        }]
      }
    },*/
    },
  }
]

/* //前半部分与portal中配置的图层title一致
export var OPERATION_SERVICE_LAYERS = {
  //可以加入场景的服务
  //基础地理
  // '建筑白模': 'WHITE_BUILDING'
},

export var BASEMAP_REFERENCE_LAYERS = {
  // 'JSDT':'CM_LAYER'
} */
